﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>无线点餐平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/style/js/jquery.js"></script>
<script type="text/javascript" src="/style/js/page_common.js"></script>
<link href="/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/style/css/index_1.css" />

	<script>
		function changeState(id,state){
			//alert(state)
			state = (state==0?1:0);
			//alert(state)
			location.href = "/desk/changeState/"+id+"/"+state;
		}
	</script>
</head>
<body>
<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">
			<img border="0" width="13" height="13" src="/style/images/title_arrow.gif"/> 餐桌列表
		</div>
    </div>
	<div id="TitleArea_End"></div>
</div>


<!-- 过滤条件 -->
<div id="QueryArea">
	<form action="" method="post">
		<input type="text" name="name" placeholder="请输入餐桌名称">
		<input type="submit" value="搜索">
	</form>
</div>


<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
    <table class="MainArea_Content" cellspacing="0" cellpadding="0">
        <!-- 表头-->
        <thead>
            <tr align="center" valign="middle" id="TableTitle">
				<td>编号</td>
				<td>桌名</td>
				<td>状态</td>
				<td>预定时间</td>
				<td>操作</td>
			</tr>
		</thead>	
		<!--显示数据列表 -->
        <tbody id="TableData">
			<tr class="TableDetail1" th:each="desk : ${deskList}">
				<td align="center" th:text="${desk.id}">1&nbsp;</td>
				<td align="center" th:text="${desk.name}"> 纽约&nbsp;</td>
				<td align="center" th:text="${desk.state == 0 ? '空闲' :  '预定'}">预定</td>
				<td align="center" th:text="${#dates.format(desk.booktime,'yyyy-MM-dd HH:mm:ss')}">2014-12-08 23:31:12</td>
				<td>
					<a th:href="|javascript:changeState(${desk.id},${desk.state});|" class="FunctionButton">[[${desk.state==0 ? '预定' : '退桌'}]]</a>
					<a th:href="|/desk/delDesk/${desk.id}|"  class="FunctionButton">删除</a>
				</td>
			</tr>
        </tbody>
    </table>
	
   <!-- 其他功能超链接 -->
	<div id="TableTail" align="center">
		<div class="FunctionButton"><a href="/index/page_saveDesk">添加</a></div>
    </div> 
</div>
</body>
</html>
